package com.atguigu.blog.service.impl;

import com.atguigu.blog.mapper.ArticleMapper;
import com.atguigu.blog.pojos.Article;
import com.atguigu.blog.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author CF
 * @date 2023/8/19 9:37
 */
@Service
public class ArticleServiceImpl implements ArticleService {
    @Autowired
    private ArticleMapper articleMapper;
    @Override
    public List<Article> queryList(Integer cid) {
        return articleMapper.findArticleListByCid(cid);
    }

    @Override
    public Article findArticleById(Integer id) {
        return articleMapper.findArticleById(id);
    }

    @Override
    public boolean addArticle(Article article) {
        return articleMapper.addArticle(article);
    }

    @Override
    public boolean deleteArticleById(Integer id) {
        return articleMapper.deleteArticleById(id);

    }
}
